package org.jfonia.musicxml.model;

import java.util.ArrayList;

import org.w3c.dom.Node;

public class Measure extends Element
{
	private ArrayList<MeasureElement>	elements			= new ArrayList<MeasureElement>();

	private BarLine leftBarLine = null;
	private BarLine rightBarLine = null;
	private int     duration = 0;
	private int	    remainingDuration = 0;
	private boolean newSystem = false;


	public Measure(Node node)
	{
		super(node);
	}
	
	

	public void setDuration(int duration)
	{
		this.duration = duration;
	}

	public int getDuration()
	{
		return duration;
	}

	public void setMeasureElementList(ArrayList<MeasureElement> elements)
	{
		this.elements = elements;
	}

	public ArrayList<MeasureElement> getMeasureElementList()
	{
		return elements;
	}

	public void addElement(MeasureElement me)
	{
		elements.add(me);
	}
	
	public void setRemainingDuration(int remainingDuration)
	{
		this.remainingDuration = remainingDuration;
	}

	public int getRemainingDuration()
	{
		return remainingDuration;
	}

	public BarLine getLeftBarLine()
	{
		return leftBarLine;
	}

	public BarLine getRightBarLine()
	{
		return rightBarLine;
	}


	public ArrayList<MeasureElement> getElements()
	{
		return elements;
	}

	public void setLeftBarLine(BarLine leftBarLine)
	{
		this.leftBarLine = leftBarLine;
	}

	public void setRightBarLine(BarLine rightBarLine)
	{
		this.rightBarLine = rightBarLine;
	}
	
	public boolean isNewSystem()
	{
		return newSystem;
	}

	public void setNewSystem(boolean newSystem)
	{
		this.newSystem = newSystem;
	}
}
